/**
 * 加入班级
 */
function classesJoin(classesId,requestURL) {
    $.ajax({
        url: baseloaction + '/web/classes/member/join',
        data: {'classesId': classesId,'requestURL':requestURL},
        dataType: 'json',
        success: function (response) {
            if (response.success) {
                $('#classes-join')
                    .html('+ 已加入')
                    .attr('disabled', true)
                    .attr('class', 'btn btn-default btn-rounded')
                    .prev()
                    .attr('disabled', false);
                icModale(0, '', '加入班级成功');
            } else {
                //icModale(0, '', response.message);
                layer.open({
                    type: 1,
                    title: '友情提示',
                    content: "亲,加入之前需要报名此班级的课程 ,才可加入此班级!是否要报名此课程?",
                    btn: ['立即报名', '我再想想 '],
                    area: 'auto',
                    btnAlign: 'c',
                    shade: [0.3, '#000000'],
                    skin: 'lay_ppComment__wrap',
                    yes: function (index) {
                        var courseId = $('#courseId').val();
                        window.location = baseloaction + '/web/course/courseInfo?courseId=' + courseId;
                        layer.close(index);
                    },
                    btn2: function (index) {
                        layer.close(index);
                    }
                });
            }
        }
    });
}